<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:76:"/www/wwwroot/zaozao/public/../application/admin/view/h5wxpay/selectroom.html";i:1596850870;}*/ ?>
<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>微信物业缴费</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="wap-font-scale" content="no">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1,user-scalable=no">
    <meta name="keywords" content="">  
    <meta name="description" content="">

    <link rel="stylesheet" type="text/css" href="/static/admin2/css/public.css">

    <link rel="stylesheet" type="text/css" href="/static/admin2/css/mobileSelect.css">
    <script src="/static/admin2/js/mobileSelect.js" type="text/javascript"></script>
    <script src="/static/admin2/js/jquery.min.js" type="text/javascript"></script>
    <style>
        .pay{
            width:100%;
            height:50px;
            text-align: center;
            background-color: rgb(0, 140, 255);
            border-radius: 3px;
            color:white;
            font-size:20px;
            border:0px;
        }
        .title{
            text-align: center;
            font-size: 18px;
            height:40px;
            line-height: 40px;
            margin-top:0px;
        }
        .demo div{
             font-size: 20px;
        }
    </style>
</head>
<body>


<div class="contain">
    <div class="fixWidth">
        <div class="nav" style="display: flex">
            <div class="title">
                 <image src="/static/admin/images/position.png" style="width: 20px;height: 20px;margin:0px" />
                <?php echo $communityinfo['community_name']; ?>

            </div>
        </div>
        <div class="demo">
            <div id="group" style="font-size: 20px">请选择组团</div>
            <div id="building" style="font-size: 20px">请选择楼栋</div>
            <div id="unit"  style="font-size: 20px">请选择单元</div>
            <div id="room" style="font-size: 20px">请选择房屋</div>
        </div>
        <div  style="margin-top:120px">
            <button  class="pay" onclick="room_submit()">下一步</button>
        </div>
        
    </div>

</div>


<script>
    function room_submit(){
        var community_id='<?php echo $communityinfo['community_id']; ?>';
        var group=$('#group').html();
        var building=$('#building').html();
        var unit=$('#unit').html();
        var room = $('#room').html();
        var url = '<?php echo url("getroominfo"); ?>';
        $.post(url, {community_id: community_id,group: group,building:building,unit:unit,room:room}, function(r){ 
                console.log(r);
                if(r.errorCode=="1"){
                    alert(r.errorMsg);
                    return false;
                }else{
                    window.location.href="<?php echo url('billinfo'); ?>?id="+r.roominfo.id
                }
        },'json')    
    }

    function room_submit_discount(){
        var community_id='<?php echo $communityinfo['community_id']; ?>';
        var group=$('#group').html();
        var building=$('#building').html();
        var unit=$('#unit').html();
        var room = $('#room').html();
        var url = '<?php echo url("getroominfo"); ?>';
        $.post(url, {community_id: community_id,group: group,building:building,unit:unit,room:room}, function(r){ 
                console.log(r);
                if(r.errorCode=="1"){
                    alert(r.errorMsg);
                    return false;
                }else{
                    window.location.href="<?php echo url('billinfo_discount'); ?>?id="+r.roominfo.id
                }
        },'json')    
    }
</script>
<script type="text/javascript">

    var weekdayArr=<?php echo $str; ?>;
    console.log(weekdayArr);
    //----------------------------------------------------------
    //只有trigger 和 wheels 是必要参数  其他都是选填参数
    var mobileSelect1 = new MobileSelect({
        id1:"group",
        trigger: '#group', 
        title: '选择组团',  
        wheels: [
                    {data: weekdayArr}
                ],
        position:[0] //初始化定位 打开时默认选中的哪个  如果不填默认为0
    });

    /*var mobileSelect2 = new MobileSelect({
        id1:"building",
        trigger: '#building',
        title: '选择楼栋',
        wheels: [
                    {data: ''}   
                ],
        position:[0]
    });
    mobileSelect2.wheel="[{data: 'weekdayArr'}]";*/
    function yzl(t){
        if(t=="group"){
            var group=$('#group').html();
            var url = '<?php echo url("getbuilding"); ?>';
            var community_id='<?php echo $communityinfo['community_id']; ?>';
            $.post(url, {community_id: community_id,group: group}, function(r){
               
                console.log(r);   
                var mobileSelect2 = new MobileSelect({
                    id1:"building",
                    trigger: '#building',
                    title: '选择楼栋',
                    wheels: [
                                {data: r}   
                            ],
                    position:[0]
                });
                 document.getElementById("building").click();
            })  
        }

        if(t=="building"){
            var group=$('#group').html();
            var building=$('#building').html();
            var url = '<?php echo url("getunit"); ?>';
            var community_id='<?php echo $communityinfo['community_id']; ?>';
            $.post(url, {community_id: community_id,group: group,building:building}, function(r){ 
                console.log(r);
                var mobileSelect3 = new MobileSelect({
                    id1:"unit",
                    trigger: '#unit',
                    title: '选择单元',
                    wheels: [
                                {data: r}   
                            ],
                    position:[0]
                });
                 document.getElementById("unit").click();
            })  
        }
        if(t=="unit"){
            var group=$('#group').html();
            var building=$('#building').html();
            var unit=$('#unit').html();
            var url = '<?php echo url("getroom"); ?>';
            var community_id='<?php echo $communityinfo['community_id']; ?>';
            $.post(url, {community_id: community_id,group: group,building:building,unit:unit}, function(r){ console.log(r);
                var mobileSelect4 = new MobileSelect({
                    id1:"room",
                    trigger: '#room',
                    title: '选择房号',
                    wheels: [
                                {data: r}   
                            ],
                    position:[0]
                });
                 document.getElementById("room").click();
            })  
        }
    }





</script>




</body>
</html>